package com.lee.dutylower.domain;

import android.support.annotation.NonNull;

import com.lee.dutylower.db.greenEntity.DutySoldierRecord;

import java.util.Comparator;

/**
 * Created by lijie on 2017/8/19.
 */

public class DutySoldierRecordComparator implements Comparator<DutySoldierRecord> {
    @Override
    public int compare(@NonNull DutySoldierRecord s1, @NonNull DutySoldierRecord s2) {
        int result  = s1.getCounts() - s2.getCounts();
        if (result == 0){
            result = s1.getDaofweek() - s2.getDaofweek();
            if (result == 0){
                result = (int) (s1.getId() - s2.getId());
            }
        }
        return result;
    }
}
